package cn.itcast.bos.web.action.base;

import java.util.List;

import org.apache.struts2.ServletActionContext;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Actions;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import cn.itcast.bos.domain.base.TakeTime;
import cn.itcast.bos.domain.utils.BaseAction;
import cn.itcast.bos.service.base.TakeTimeService;

@ParentPackage("json-default")
@Namespace("/")
@Controller
@Actions
@Scope("prototype")
public class TakeTimeAction extends BaseAction<TakeTime> {
	
	
	@Autowired
	TakeTimeService takeTimeService;

	@Action(value = "findTakeTime", results = { @Result(name = "success", type = "json") })
	public String findAllTkaeTime() {

		List<TakeTime> taketimes= takeTimeService.findAll();
		
		ServletActionContext.getContext().getValueStack().push(taketimes);
		return SUCCESS;
	}
}
